package com.mt.restaurant.entity.sale;

import javax.persistence.*;
import java.io.Serializable;
import com.mt.common.core.annotation.DColumn;
import com.mt.common.core.annotation.DEntity;
import com.mt.common.core.web.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;



import com.mt.restaurant.entity.material.Supplier;
import com.mt.restaurant.entity.staff.Staff;
import com.mt.restaurant.entity.material.MaterialOrder;

@DEntity(label="付款记录",comment="",moduleLabel="销售管理")
@Entity(name="restaurant_payment_record")
@Table(name = "restaurant_payment_record" , indexes = { @Index(name = "index_supplier_id", columnList = "supplier_id"),@Index(name = "index_material_order_id", columnList = "material_order_id"),@Index(name = "index_operator_id", columnList = "operator_id")  })
@ApiModel(description = "付款记录:")
public class PaymentRecord extends BaseEntity implements Serializable{
	private static final long serialVersionUID = 1L;

	@DColumn(index=3,label="供应商",foreignEntity="Supplier",comment="",component="对象选择",where=false)
	@ApiModelProperty(value = "供应商:")
	@Column(name="supplier_id",length=255,nullable=false,unique=false)
	private Long supplierId;

	@Transient
	private Supplier supplier;

	@Transient
	@ApiModelProperty(value = "供应商名称:")
	@DColumn(index=3,label="供应商",foreignEntity="Supplier",comment="")
	private String supplierName;

	@DColumn(index=4,label="付款金额",comment="",component="数字，小数",where=false)
	@ApiModelProperty(value = "付款金额:")
	@Column(name="amount",length=255,nullable=false,unique=false)
	private Double amount;

	@DColumn(index=5,label="付款状态",comment="",component="文本",where=false)
	@ApiModelProperty(value = "付款状态:")
	@Column(name="status",length=255,nullable=false,unique=false)
	private String status;

	@DColumn(index=6,label="订单",foreignEntity="MaterialOrder",comment="",component="对象选择",where=false)
	@ApiModelProperty(value = "订单:")
	@Column(name="material_order_id",length=255,nullable=false,unique=false)
	private Long materialOrderId;

	@Transient
	private MaterialOrder materialOrder;

	@Transient
	@ApiModelProperty(value = "订单名称:")
	@DColumn(index=6,label="订单",foreignEntity="MaterialOrder",comment="")
	private String materialOrderName;

	@DColumn(index=7,label="付款人员id",foreignEntity="Staff",comment="使用Staff表里的付款人员",component="对象选择",where=false)
	@ApiModelProperty(value = "付款人员id:使用Staff表里的付款人员")
	@Column(name="operator_id",length=255,nullable=false,unique=false)
	private Long operatorId;

	@Transient
	private Staff operator;

	@Transient
	@ApiModelProperty(value = "付款人员id名称:使用Staff表里的付款人员")
	@DColumn(index=7,label="付款人员id",foreignEntity="Staff",comment="使用Staff表里的付款人员")
	private String operatorName;


	public Long getSupplierId() {
		return this.supplierId;
	}

	public void setSupplierId(Long supplierId) {
		this.supplierId = supplierId;
	}

	public Double getAmount() {
		return this.amount;
	}

	public void setAmount(Double amount) {
		this.amount = amount;
	}

	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Long getMaterialOrderId() {
		return this.materialOrderId;
	}

	public void setMaterialOrderId(Long materialOrderId) {
		this.materialOrderId = materialOrderId;
	}

	public Long getOperatorId() {
		return this.operatorId;
	}

	public void setOperatorId(Long operatorId) {
		this.operatorId = operatorId;
	}

	public Supplier getSupplier() {
		return this.supplier;
	}

	public void setSupplier(Supplier supplier) {
		if(supplier == null){
		}
		else
		{
		this.supplierId = supplier.getEid();
		this.supplier = supplier;		
		}
}

	public String getSupplierName() {
		return this.supplierName;
	}

	public void setSupplierName(String supplierName) {
		this.supplierName = supplierName;
	}

	public MaterialOrder getMaterialOrder() {
		return this.materialOrder;
	}

	public void setMaterialOrder(MaterialOrder materialOrder) {
		if(materialOrder == null){
		}
		else
		{
		this.materialOrderId = materialOrder.getEid();
		this.materialOrder = materialOrder;		
		}
}

	public String getMaterialOrderName() {
		return this.materialOrderName;
	}

	public void setMaterialOrderName(String materialOrderName) {
		this.materialOrderName = materialOrderName;
	}

	public Staff getOperator() {
		return this.operator;
	}

	public void setOperator(Staff operator) {
		if(operator == null){
		}
		else
		{
		this.operatorId = operator.getEid();
		this.operator = operator;		
		}
}

	public String getOperatorName() {
		return this.operatorName;
	}

	public void setOperatorName(String operatorName) {
		this.operatorName = operatorName;
	}



}
